package com.mofofa.maozy.network

import com.mofofa.maozy.data.*
import com.mofofa.maozy.utils.AppConfigUtil
import kotlinx.coroutines.*

object ApiToolReposity : ApiBaseReposity() {
    val mMaozyJob = Job()
    val mMaozyScope = CoroutineScope(mMaozyJob)

    fun fetchMaozyAppMaozyConfig(reqBase: ReqBase) {
        mMaozyScope.launch {
            try {
                val response =
                    ApiToolNetwork.fetchMaozyAppMaozyConfig(reqBase)
                if (response.code.equals("0000", true)) {
                    val obj = response.obj
                    AppConfigUtil.mMaozySysMaozyConfig = obj
                }
            } catch (e: Exception) {
                e.printStackTrace()
            }
        }
    }

}